package com.unitd.frame.comm.exception;

/**
 * @desc 自定义的异常类,主要用于定义、抛出属于frame-filesystem文件系统中针对文件操作时出现的异常
 * @filename FileSystemException.java
 * @copyright www.unitd.com
 * @author Hudan
 * @version 1.0
 * @date 2017/3/8
 */
public class FileSystemException extends UnitdBaseException {

	/** 使用的第三方分布式文件系统的名字(比如: fastDFS、qiniu等) */
	private String privoderName;
	/**  错误代码或消息(第三方文件系统处理时反馈的异常信息) */
	private int code;

	/**
	 * @desc 构造方法
	 * @param privoderName 文件服务提供者
	 */
	public FileSystemException(String privoderName) {
		super(privoderName);
		this.privoderName = privoderName;
	}

	public FileSystemException(String privoderName, Throwable cause) {
		super(cause);
		this.privoderName = privoderName;
	}

	public FileSystemException(String privoderName, String message) {
		this(privoderName, 500, message);
	}

	public FileSystemException(String privoderName, int code, String message) {
		super(message);
		this.code = code;
		this.privoderName = privoderName;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
}